

export function getCurrentTimeStamp() {
    // @ts-ignore
    var timestamp = Date.parse(new Date()) / 1000;
    return timestamp;
}

export function getCastCurrentDate(currentTime:number) {
    var date = new Date(currentTime * 1000);
    var year = date.getFullYear();
    var month = ("0" + (date.getMonth() + 1)).slice(-2); // 月份是从0开始的，所以要加1
    var day = ("0" + date.getDate()).slice(-2);
    var hours = ("0" + date.getHours()).slice(-2);
    var minutes = ("0" + date.getMinutes()).slice(-2);
    var seconds = ("0" + date.getSeconds()).slice(-2);
    // 拼接日期和时间
    return  year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
}


